using System;
using System.Net;
using System.Runtime.Serialization;

namespace Pegasus.ServiceModel
{
	/// <summary>
	/// This data contract is used to pass information between nodes on the peer network.
	/// </summary>
	[DataContract]
	internal class NodeData
	{
		/// <summary>
		/// The name of the node.  This name must be unique within the mesh.
		/// </summary>
		[DataMember]
		internal string Name;

		/// <summary>
		/// The name of the computer that the client is running on.
		/// </summary>
		[DataMember]
		internal string MachineName;

		/// <summary>
		/// This IP address that the node is listening on for private communications.
		/// </summary>
		[DataMember]
		internal IPAddress IPAddress;

		/// <summary>
		/// This TCP port that the node is listening on for private communications.
		/// </summary>
		[DataMember]
		internal int Port;

		/// <summary>
		/// This is a user defined object (DataContract) that is passed with the node data.
		/// </summary>
		/// <remarks>
		/// I can't seem to get broadcast message to work if this value has a DataContract
		/// object assigned to it.  Message is sent but not received. No errors or anything.
		/// For now we will change this to a string and send the object as a XML string
		/// using the Pegasus XML serializer.
		/// </remarks>
		[DataMember]
		internal string Tag;
	}
}
